<template>
  <div class="item-content">
    <renders :ele="item" v-model="formValue[item.name]" />
  </div>
</template>
<script>
import draggable from 'vuedraggable'
export default {
  name: 'XFrom',
  components: { draggable },
  props: {
    item: {
      type: [Array, Object],
      default: null
    },
    form: {
      type: [Array, Object],
      default: null
    }
  },
  data() {
    return {

    }
  },
  computed: {
    formValue: {
      get() {
        return this.form
      },
      set(oo) {
        console.log(oo)
      }
    }
  },
  watch: {

  },
  created() {

  },
  methods: {
    dsadsa(a) {
      console.log(a)
    },
    submitForm(item) {
      if (item.name == 'submitForm') {
        this.$emit('submitForm', this.formValue)
      } else {
        item.click && item.click()
      }
    }
  }
}
</script>
<style lang="scss" scoped>
  .item-content{
    width: 100%;
    & > {
      width: 100%;
    }
  }
  .form_input{
      width: 100%;
      &.form_input_rate{
        margin-top: 8px;
      }
  }
</style>
